#include<stdio.h>
#include<stdbool.h>

bool judge_leap(int year)
{
	if(year%4==0&&year%100!=0||year%400==0)
	return true;
	else return false;
}

int main()
{
	int year,month,day;
	printf("请输入年月日\n");
	scanf("%d %d %d",&year,&month,&day);
	
	//要判断是否是闰年
	int daySum=0;
	switch(month)
	{
		case 1:daySum+=31;
		case 2:daySum+=28;
		case 3:daySum+=31;
		case 4:daySum+=30;
		case 5:daySum+=31;
		case 6:daySum+=30;
		case 7:daySum+=31;
		case 8:daySum+=31;
		case 9:daySum+=30;
		case 10:daySum+=31;
		case 11:daySum+=30;
		case 12:daySum+=31;
	}
	int Day;
	if(judge_leap(year))
	{
		Day=365-daySum+day+1;
		printf("第%d天\n",Day);
	}
	else
	{
		Day=365-daySum+day;
		printf("第%d天\n",Day);		
	}
	
	
	
	
	
	
	
	return 0;
}